package com.audaque.springboot.foshanupload.core.enums;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @author helen
 * @since 2019/12/25
 * 参考 HttpStatus
 */
@Schema(description = "响应对象枚举")
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public enum ResultCodeEnum {

    SUCCESS(true, 0, "操作成功"),
    FAILE(false, 500, "服务端异常"),
    NOT_LOGIN(false, 4011, "未登录"),
    LOGIN_FAILE(false, 4012, "登录失败"),
    SESSION_TIMEOUT(false, 4013, "会话超时"),
    SESSION_KIDOUT(false, 4013, "会话被踢"),
    UNAUTHORIZED(false, 401, "未授权"),
    FORBIDDEN(false, 403, "无权限"),
    GATEWAY_EXCEPTION(false, 502, "网关异常"),
    DUPLICATE_KEY(false, 551, "主键冲突");

    @Schema(description = "是否成功")
    private Boolean success;
    @Schema(description = "错误码")
    private  Integer status;
    @Schema(description = "错误信息")
    private String description;


}
